package com.taxshare.manager.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.taxshare.manager.entity.OrganizeEntity;
import com.taxshare.manager.entity.UserOrganizeEntity;
import com.taxshare.manager.view.vo.CompanyVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: UserOrganizeMapper
 * @Description:
 * @author luozhongyi
 * @since 2021-02-04
 */
@Mapper
public interface UserOrganizeMapper extends BaseMapper<UserOrganizeEntity> {

    /**
     * 批量插入用户组织信息
     * @param list
     * @return
     */
    int insertUserOrgBatch(List<UserOrganizeEntity> list);

    /**
     * 初始化登录用户组织
     * @param queryWrapper
     * @return
     */
    List<String> initLoginUserOrgs(@Param(Constants.WRAPPER)Wrapper<UserOrganizeEntity> queryWrapper);

    /**
     * 初始化登录用户税号
     * @param queryWrapper
     * @return
     */
    List<CompanyVO> initLoginUserTaxNos(@Param(Constants.WRAPPER)Wrapper<UserOrganizeEntity> queryWrapper);

    /**
     * 初始化登录用户不能操作的组织信息
     * @param paramsMap
     * @return
     */
    List<String> initLoginUserUnableOrgs(Map<String, String> paramsMap);

    /**
     * 获取集团组织
     * @return
     */
    List<OrganizeEntity> initTenantOrgs();

    /**
     * 获取所有税号信息
     * @return
     */
    List<CompanyVO> initAllTaxNos();

}
